#include "StdAfx.h"
#include "BieuThucTich.h"

BieuThucTich::BieuThucTich()
{
}
BieuThucTich::BieuThucTich(BieuThuc BTa, BieuThuc BTb)
{
	BT1 = BTa;
	BT2 = BTb;
}

double BieuThucTich::TinhGiaTri()
{
	return (BT1.TinhGiaTri()*BT2.TinhGiaTri());
}

BieuThuc BieuThucTich::TinhDaoHam()
{
	BieuThuc BTa = BT1.TinhDaoHam();
	BieuThuc BTb = BT2.TinhDaoHam();
	BieuThucTich BTc, BTd;
	BTc.BT1 = BT1.TinhDaoHam();
	BTc.BT2 = BT2;
	BTd.BT1 = BT1;
	BTd.BT2 = BT2.TinhDaoHam();
	BieuThucTong KQ;
	KQ.Dau = 1;
	KQ.BT1 = BTc;
	KQ.BT2 = BTd;
	return KQ;
}